//
//  DailyDietInfo.m
//  SHHCPhone
//
//  Created by gfsh on 14-7-3.
//  Copyright (c) 2014年 sheng long. All rights reserved.
//

#import "DailyDietInfo.h"

@implementation DailyDietInfo
// 对属性编码，归档的时候调用
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:_mealName forKey:@"mealName"];
    [aCoder encodeBool:_isFold forKey:@"isFold"];
    [aCoder encodeObject:_dietInfos forKey:@"dietInfos"];
}

// 对属性解码，解归档的时候调用
- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        _mealName = [aDecoder decodeObjectForKey:@"mealName"];
        _isFold = [aDecoder decodeBoolForKey:@"isFold"];
        _dietInfos = [aDecoder decodeObjectForKey:@"dietInfos"];
    }
    return self;
}
@end

@implementation DietInfo
// 对属性编码，归档的时候调用
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:_mealIndex forKey:@"mealIndex"];
    [aCoder encodeObject:_foodID forKey:@"foodID"];
    [aCoder encodeObject:_picPath forKey:@"picPath"];
    [aCoder encodeObject:_foodName forKey:@"foodName"];
    [aCoder encodeObject:_foodDetail forKey:@"foodDetail"];
    [aCoder encodeObject:_content forKey:@"content"];
    [aCoder encodeObject:_weight forKey:@"weight"];
    [aCoder encodeObject:_amount forKey:@"amount"];
    [aCoder encodeObject:_energy forKey:@"energy"];
    [aCoder encodeObject:_protein forKey:@"protein"];
    [aCoder encodeObject:_fat forKey:@"fat"];
    [aCoder encodeObject:_CHO forKey:@"CHO"];
    [aCoder encodeObject:_calory100 forKey:@"calory100"];
    [aCoder encodeObject:_method forKey:@"method"];
    [aCoder encodeBool:_dish forKey:@"dish"];
}

// 对属性解码，解归档的时候调用
- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        _mealIndex = [aDecoder decodeObjectForKey:@"mealIndex"];
        _foodID = [aDecoder decodeObjectForKey:@"foodID"];
        _picPath = [aDecoder decodeObjectForKey:@"picPath"];
        _foodName = [aDecoder decodeObjectForKey:@"foodName"];
        _foodDetail = [aDecoder decodeObjectForKey:@"foodDetail"];
        _content = [aDecoder decodeObjectForKey:@"content"];
        _weight = [aDecoder decodeObjectForKey:@"weight"];
        _amount = [aDecoder decodeObjectForKey:@"amount"];
        _energy = [aDecoder decodeObjectForKey:@"energy"];
        _protein = [aDecoder decodeObjectForKey:@"protein"];
        _fat = [aDecoder decodeObjectForKey:@"fat"];
        _CHO = [aDecoder decodeObjectForKey:@"CHO"];
        _calory100 = [aDecoder decodeObjectForKey:@"calory100"];
        _method = [aDecoder decodeObjectForKey:@"method"];
        _dish = [aDecoder decodeBoolForKey:@"dish"];
    }
    return self;
}
@end